from pydantic import BaseModel
from typing import List, Dict, Any, Optional

class Text2SqlRequest(BaseModel):
    question: str
    context: Optional[str] = None

class SqlResponse(BaseModel):
    question: str
    generated_sql: str
    confidence_score: float
    context_documents: List[Dict[str, Any]]

class EvaluationRequest(BaseModel):
    question: str
    generated_sql: str
    expected_sql: Optional[str] = None

class EvaluationResult(BaseModel):
    question: str
    generated_sql: str
    expected_sql: Optional[str] = None
    similarity_score: float
    is_correct: bool
    evaluation_details: Dict[str, Any]

class QueryDocument(BaseModel):
    id: str
    document: str
    metadata: Dict[str, Any]
    distance: float

class Q2SqlPair(BaseModel):
    question: str
    sql: str